@charset "UTF-8";

.crop-container {
  display: flex;
  justify-content: center;
  height: 40px;
  background-color: #313239;

  .crop-slider {
    position: relative;
    display: flex;
    align-items: center;
    width: 400px;
    height: 100%;
    padding: 0 10px;
    background-color: #313239;
    border: 1px solid #46484d;
    border-top: none;
    border-bottom: none;
    user-select: none;

    * {
      box-sizing: border-box;
    }

    .crop-time-line-container {
      position: relative;
      flex: 1;
      height: 100%;

      .crop-time-line {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 100%;
        height: 4px;
        background-color: rgba(255, 255, 255, 0.5);
        border-radius: 2px;
      }
    }

    .media-duration {
      margin-left: 5px;
      width: 55px;
      font-size: 14px;
      color: #fff;
    }

    .cursor-time-hint {
      position: absolute;
      left: 0;
      width: 2px;
      height: 100%;
      opacity: 0;
      will-change: transform;

      .cursor-line {
        position: relative;
        height: 100%;
        background-color: #fff;

        .cursor-sensor {
          position: absolute;
          width: 6px;
          height: 100%;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%);
        }
      }

      .cursor-time {
        position: absolute;
        font-size: 12px;
        line-height: 24px;
        padding: 2px 4px;
        top: -35px;
        left: 50%;
        transform: translateX(-50%);
        background-color: #1795ff;
        border-radius: 4px;

        &:after {
          position: absolute;
          left: 50%;
          bottom: 0;
          transform: translate(-50%, 10px);
          display: block;
          content: '';
          width: 0;
          height: 0;
          border: 5px solid #1795ff;
          border-right-color: transparent;
          border-bottom-color: transparent;
          border-left-color: transparent;
        }
      }

    }


    .cropping {
      opacity: 1;

      .cursor-time {
        color: #1795ff;
        background-color: #fff;

        &:after {
          border-top-color: #fff;
        }
      }
    }

    .crop-moving-cursor {
      opacity: 1;

      &:before {
        content: '';
        display: block;
        position: absolute;
        top: 50%;
        left: 0;
        transform: translate(-10px, -50%);
        width: 0;
        height: 0;
        border: 4px solid #fff;
        border-top-color: transparent;
        border-bottom-color: transparent;
        border-left-color: transparent;
      }

      &:after {
        content: '';
        display: block;
        position: absolute;
        top: 50%;
        right: 0;
        transform: translate(10px, -50%);
        width: 0;
        height: 0;
        border: 4px solid #fff;
        border-top-color: transparent;
        border-bottom-color: transparent;
        border-right-color: transparent;
      }

      .cursor-time {
        color: #fff;
        background-color: #1795ff;
      }
    }

    .moving-cursor {
      opacity: 1;
      color: #fff;
    }

    .crop-range {
      position: absolute;
      left: 0;
      height: 100%;
      background-color: rgba(23, 149, 255, 0.2);
    }

    .crop-range-hover {
      background-color: rgba(23, 149, 255, 0.6);
    }

    .crop-range-dragging {
      background-color: rgba(23, 149, 255, 0.6);
    }
  }

  .crop-panel {
    position: relative;
    display: flex;
    height: 100%;
    margin-left: 10px;
    background-color: #313239;

    * {
      box-sizing: border-box;
    }

    .small-btn {
      padding: 0 3px;
      height: 24px;
      font-size: 12px;
      line-height: 24px;
      text-align: center;
      color: #fff;
      border: none;
      background: none;
      cursor: pointer;
    }

    .crop-time-area {
      position: absolute;
      left: 0;
      bottom: 40px;
      background-color: #313239;

      .crop-time-header {
        display: flex;
        align-items: center;
        width: 100%;
        height: 32px;
        padding: 0 10px;
        border: 1px solid #46484d;

        .header-crop-icon {
          background-position: 24px 0;
          cursor: auto;
        }

        .text {
          flex-grow: 1;
          font-size: 14px;
          text-align: left;
          color: #fff;
        }
      }

      .crop-time-body {
        overflow-y: auto;
        overflow-x: hidden;
        transition: height .3s;

        $item-height: 40px;
        $max-count: 10;
        // 循环，根据menu个数来确定下拉框高度
        @for $count from 0 through $max-count {
          &[data-count="#{$count}"] {
            height: $item-height * $count;
          }
        }
      }

      .crop-time-body-hide {
        height: 0;
      }
    }

    .crop-time-item {
      display: flex;
      align-items: center;
      height: 40px;
      padding: 0 10px;

      &[data-highlight="1"] {
        background-color: #40414a;
      }

      &:hover {
        background-color: #40414a;
      }
    }

    .time-area {
      flex-grow: 1;
      display: flex;
      justify-content: space-around;
      align-items: center;

      .time-input-area {
        display: flex;
        align-items: center;
        justify-content: space-around;
        width: 128px;
        height: 24px;
        line-height: 24px;
        border: 1px solid #46484d;

        .time-text {
          font-size: 12px;
          color: #fff;
        }

        .time-input {
          display: flex;
          justify-content: space-between;
          width: 65px;
          font-size: 14px;
          text-align: center;
          color: #9b9b9b;
          border: none;
          background: none;

          input {
            width: 20px;
            padding: 0 1px;
            background: none;
            border: none;
            color: #9b9b9b;
          }
        }
      }

      .range-text {
        font-size: 20px;
        color: #9b9b9b;
      }
    }

    .confirm-btn {
      margin: 8px;
      width: 80px;
      height: 24px;
      line-height: 24px;
      text-align: center;
      border-radius: 4px;
      color: #fff;
      background-color: #ff991b;
      cursor: pointer;
    }

    .confirm-btn-disabled {
      background-color: #9b9b9b;
      cursor: wait;
    }
  }
}
